---
id: 657823a9f4f372518614c8b7
title: Крок 16
challengeType: 20
dashedName: step-16
---

# --description--

Збільште `right_array_index` на `1` в межах блоку `else`.

# --hints--

Додайте `1` до поточного значення `right_array_index`.

```js
({
  test: () => {
    const transformedCode = code.replace(/\r/g, "");
    const merge_sort = __helpers.python.getDef("\n" + transformedCode, "merge_sort");
    const { function_body } = merge_sort;

    const allowedMatches = [
      /else:\s*[^}]*right_array_index\s*\+=\s*1/,
      /else:\s*[^}]*right_array_index\s*=\s*right_array_index\s*\+\s*1/
    ]

    const anyMatch = allowedMatches.some((match) => match.test(function_body))
    assert.isTrue(anyMatch);
  }
})
```

# --seed--

## --seed-contents--

```py
def merge_sort(array):

    middle_point = len(array) // 2
    left_part = array[:middle_point]
    right_part = array[middle_point:]

    merge_sort(left_part)
    merge_sort(right_part)

    left_array_index = 0
    right_array_index = 0
    sorted_index = 0

    while left_array_index < len(left_part) and right_array_index < len(right_part):
        if left_part[left_array_index] < right_part[right_array_index]:
            array[sorted_index] = left_part[left_array_index]
            left_array_index += 1

--fcc-editable-region--
        else:
            array[sorted_index] = right_part[right_array_index]

--fcc-editable-region--
```
